Frage

I have some question about NPP library...

This is about Step in NPP parameters. When I use NPP library, it makes me confused.

nppiSub_32s_C1RSfs(d_sink, step, d_source, step, d_terminals, step, size, 0);

that is example.. I can understand all parameters except the step. Every NPP function needs the step.

some people use width...

some people use width * sizeof(int).... (or float...)

some people make the step parameter by other library such as

nppiMalloc_32s_C1(width, height, &step);

I think if I use the library, that calculate step size.(but i don't know how to did...)

  1. What is the step parameter?

  2. How to decide step size?

  3. If I use width or width*sizeof(int), does it have an effect on the performance?

thank you for reading my question....

English is more difficult than programming...

War es hilfreich?

Lösung

As you can read in the documentation under 4.2.2.1.4

The source image line step is the number of bytes between successive rows in the image.

That means that step is calculated as step = (column elements) * sizeof(element datatyp), if there is no padding! If you uses padding, than of course the size in bytes of padded elements have to add, too.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top