void naive_rotate(int dim, pixel *src, pixel *dst)
{
int i, j;
for (j = 0; j < dim; ++j)
for (i = 0; i < dim; ++i)
dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)];
Here is my code. I am trying to optimize this but I do not really know where to start. Can someone please help me?
I don't know a lot about optimization but as far as I know you cannot really optimize a piece of code without seeing the whole program (and ideally find out where is your bottle neck).
You need to optimize this 7 lines for what? Do you think that they consume too much resources?
Have you considered finding out if you can implement some parts differently? This cannot be done without looking at your entire code.