Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Vector quantization memory problem

emilio_maggio
Beginner
221 Views
HI,
I am using the function ippsCdbkInitAlloc_L2_32f with parameter IPP_CDBK_KMEANS_NUM to train the codebook for VQ.
I would like to know what is the difference between the parameter "width" and the parameter "step".
Is step the length in bytes of a row of the input matrix?
If no what is the use of "step". Is it relatedto the memory allongnment of the input data?
If yes do you have an example of how toallocate the memory for the input?
Thanks
Emilio
0 Kudos
1 Reply
Intel_C_Intel
Employee
221 Views

hi, Emilio,

Row step in all functions from ippsr.h are in array elements, not in bytes.

The goal of step argument is the memory alignment. width should be less than or equal to step.

To allocate the aligned memory you can use ippsMalloc_32f function and step that is the multiple of 4 for 32f data or multiple of 8 for 16s data.

step=(width+3)&(~3);

ptr=ippsMalloc_32f(height*step);

Alexander

0 Kudos
Reply