Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Anirudh
Beginner
35 Views

IppsConvert_8u16s_Sfs not available?

Hi,

I have a huge array of 8u. I want to make it an array of 16s BUT swapping the bytes.

eg; input (size byte) = 0xAA h
output (size short) = 0xAA00 h instead of just plain 0x00AA h.

I was trying to find the function like ippsConvert_8u16s_Sfs which can do this, but it does not exist for these data types.

Can you suggest the most efficient way of doing this ? I need to do this repeatedly for huge arrays.

Thanks for your help.
0 Kudos
1 Reply
Ivan_Z_Intel
Employee
35 Views

int Step = 8192; /*or other*/

for ( i = 0; ( i + Step) <= HugeArrayLength; i += Step ) {

ippsConvert_8s16s( (Ipp8s *)HugeSrcArray8u, HugeDstArray16s, Step );

ippsLShiftC_16s_I( 8, HugeDstArray16s, Step );

HugeSrcArray8u += Step;

HugeDstArray16s += Step;

}

Step = HugeArrayLength - i;

if ( Step > 0 ) {

ippsConvert_8s16s( (Ipp8s HugeSrcArray8u,ugeDstArray16s, Step );

ippsLShiftC_16s_I( 8, HugeDstArray16s, Step );

}