- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the best way to take an array of struct{ int r : 16; int i : 16; } and convert to an array of Ipp32f and then on to an array of Ipp32fc.
Note: My access to the array of structs will be through a pointer, ie. I will not have access to the creation/allocation of the memory.
Can I do the following?
Side question: Does declaring an array such as dest above guarantee that it is 32 byte aligned as it would be if allocated with the ippsMalloc functions?
Note: My access to the array of structs will be through a pointer, ie. I will not have access to the creation/allocation of the memory.
Can I do the following?
//Define in some header file
typedef struct
{
int r : 16;
int i : 16;
}ri;
//Defined in the c file with "void function(ri *src, len)"
Ipp32fc dest[32];
void function(ri * src, len)
{
ippsConvert_16s32f((Ipp16s*)ri, (Ipp32f*)dest, len);
//.....
}
Side question: Does declaring an array such as dest above guarantee that it is 32 byte aligned as it would be if allocated with the ippsMalloc functions?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
yes, using ippsConvert_16s32f function should be appropriate for this purpose. To align array allocated on the stack you may do something like this:
Ipp8u buf[len * sizeof(Ipp32fc) + 31];
Ipp32f* dest = &buf[0] & (-32);
Regards,
Vladimir
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