- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to copy my own 2D matrix data to ipp8u by usingippiCopyManaged_8u_C1R.
But it couldn't copy correctly:
Only the first row of matrix can be copiedproperly. The others are wrong.
The following is my code:
a[size.width*1] is not equal to ipp_template[step*1], which means copying is wrong.
Any wrong in my code?
[cpp]#include
#include
#include
#include
#include "ipp.h" //use ipp 7.0 library
int main (void){
IppiSize size;
size.width = 512; //if it's less than 256, the copying is ok
size.height = 10;
__declspec(align(32)) unsigned char* a = (unsigned char*)malloc(size.width*size.height); //2d Matrix data
for(int i = 0; i < size.width*size.height; i++)
{
a = i %255;
}
int step;
Ipp8u *ipp_template = ippiMalloc_8u_C1( size.width, size.height, &step);
IppStatus err = ippiCopyManaged_8u_C1R((Ipp8u*)a, (Ipp8u)size.width, ipp_template, step, size, IPP_TEMPORAL_COPY);
bool bEqual = (a[size.width*1] == ipp_template[step*1]); //No equal, why?
return 0;
}
[/cpp]
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I didn't notice the type before.
Thank you very much!

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