Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CRoec1
Beginner
91 Views

Ipp for 8u->float conversion and add

Hi experts,

im struggling to implement an efficient IPP-based funtion to this simple task:

"add 8u-image to existing float-image without creating an temporary float image."

int img_sz = 1024*768;

float dest_img = new float[img_sz];
//init destination img...
//...

//now convert incoming 8u image to float and add it to destination image
unsigned char* newimg_8u= new unsigned char[img_sz];
//filled somewhere...

//create LUT for 8u->float conversion
for (int k=0;k<256;++k) m_LUT8bit = k;

//time critical part follows
//convert it with LUT to float and add the existing float-image
//optimize this?
for (int k = 0; k < img_sz ; ++k)	
 {							
	 dest_img  += m_LUT8bit[newimg_8u];
 }							

delete...

Is there an easy way to do this with IPPs or IPPi?

0 Kudos
1 Reply
Chao_Y_Intel
Employee
91 Views

Hello,

Hi,

why does the code need to define m_LUT8bit?  Is this just for converting to the float data?  A conversion function may be faster.
I does not have inplace add function for this.  If the memory for a new float image is too large,  possibly it can just provide a short buffer for each line of image data.   For example,

Ipp32f buffer[image width];

for ( i=0;i< height; i++){
   ippsConvert_8u32f(newimg_8u[in line i], buffer, width);
  
ippsAdd_32f_I(buffer, dest_img,width);

}
Thanks,
Chao

 

 

Reply