Are larger arrays more expensive to acces? Becuase i find this:
int npp = ((yi<<widthBits)+xi)<<2;
int pixP1 = np[npp];
int pixP2 = np[++npp];
int pixP3 = np[++npp];
int pixP4 = np[++npp];
to be ~0.75 the spped of this and the above is doing less
int pixP1 = getTexel(xi, yi);
int pixP2 = getTexel(xi+1, yi);
int pixP3 = getTexel(xi, yi+1);
int pixP4 = getTexel(xi+1, yi+1);
the method used above:
public final int getTexel(int x, int y){
return imgData[((y & heightMask) << widthBits) + (x & widthMask)];
}
