- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 );
}

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page