I have an array with it the first x_size*y_size values filled, and now I need to duplicate them DATA_JUMP times in the same array in later memory.
for(int i=1; i < DATA_JUMP; i++)
for(int k = 0; k < x_size*y_size; k++)
orig_depth[k + i*x_size*y_size] = orig_depth[k];
This works like I want it to, however this may slow down on large datasets. I wonder if there is a trick to do this with a little pointer arithmetic.
memcpy(orig_depth + i*x_size*y_size, orig_depth, x_size*y_size * sizeof *orig_depth);instead of the inner loop.