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

ippiDCTFwd_32f_C3R

sohrab
Beginner
466 Views
hi
How can I copy the image from BYTE* to Ipp32f* safely to be use in ippiDCTFwd_32f_C3R
can i use just memcpy(Ipp32f* , BYTE* , 720*576*3); .....?
I have the image of size 720*576; RGB in pData of Type BYTE *and having size 720*576*3
Regards
Sohrab
0 Kudos
6 Replies
sohrab
Beginner
466 Views

Hi

I think i am on the right track now by doing this

for(int i=0; i<720*576*3; i++)
{
m_pDCTSrc=pSrc;
}

where as m_pDCTSrc is Ipp32f* and pSrc is BYTE*

I just take the DCT and INVof the Video in real time but its very very slow
Input is from DVCam 25 fps and 720 * 576 RGB

and i amtesting it onXEON dual Processor

Regards
Sohrab


0 Kudos
Vladimir_Dudnik
Employee
466 Views

Hi,

I'm not sure I completely understood what you are trying to do, but seems you can take a look on ippsConvert_8u32f() function, which will copy and convert 8u data into 32f buffer. There is similar function for 2d data in ippi library.

BTW, DCT for 16s data is faster that for 32f data and should provide similar if not the same accuracy when source data is in 8u range.

Regards,
Vladimir

0 Kudos
boblue
Beginner
466 Views

Hi,

I guess the question was: BYTE* is a mem location may not be aligned as is requiredfor IPP fucntions to operate on. So if I have some data in BYTE*, but now I need to use ippiDCTFwd_32f_ to apply dct on it, i need to first copy the data pointed by BYTE* to IPP32f*. Is there a fast way to do it, can we just use memcpy to do it?

regards,

b.

To make the question more clear, forget about 8u to 32fconversion.say if we want to use ippiDCTFwd_8u_ on data allocated with pData=(unsigned char*)malloc(..), we need to memcpy(IPP8u*, pData, ), and then apply ippiDCT on the IPP8u* data. Is memcpy the best choice?

0 Kudos
Vladimir_Dudnik
Employee
466 Views

You probably know that modern compilers implements memcpy as intrinsic function. It is quite effective on small amount of data (say less then 64..128 bytes). If you have more data, I would recomend you to use ippsCopy or ippiCopy for appropriate data type.

Regards,
Vladimir

0 Kudos
boblue
Beginner
466 Views

Thanks for the reply. allow me to follow up:

Say we want to copy more than 128 bytes of data, ippsCopy and ippiCopy require both src and dst to be Ipp*, i.e. pointers to aligned mem locations, sothey can not be used to copy non-aligned to aligned, can they? Appreciate your confirmation.

regards,

b.

0 Kudos
Vladimir_Dudnik
Employee
466 Views

Hello,

of course they can. If you look carefully through IPP documentation you will find that pointers should be aligned to data type size. The function will work faster if you align pointers to processor cache line size. So it is only hint for you, to obtain th e max possible speed you need align pointers but IPP function will work in any case.

Regards,
Vladimir

0 Kudos
Reply