G
Gernot Frisch
Hi,
I have some code that scales from an image buffer to the screen buffer
(line by line).
Assume:
int Width; // Width of image (e.g. 32)
int zWidth; // Width of screen output (e.g. 192)
// Now, I perform interpolation of:
// --------------------------------
Offset2 = x * ((float)Width / (float)zWidth);
// like this:
// --------------
int fracx = (1<<16)/zWidth;
do
{
Offset2 = y_val + ( (XWidth * fracx) >>16);
[...]
}while(++pScreen, XWidth+=Width, ++x<linelen);
// Where { XWidth = x*(float)Width } so to say.
Is there any faster way (on ARM processors) like this? I mean: I still
have an multiplication and a shifting for every pixel.
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
I have some code that scales from an image buffer to the screen buffer
(line by line).
Assume:
int Width; // Width of image (e.g. 32)
int zWidth; // Width of screen output (e.g. 192)
// Now, I perform interpolation of:
// --------------------------------
Offset2 = x * ((float)Width / (float)zWidth);
// like this:
// --------------
int fracx = (1<<16)/zWidth;
do
{
Offset2 = y_val + ( (XWidth * fracx) >>16);
[...]
}while(++pScreen, XWidth+=Width, ++x<linelen);
// Where { XWidth = x*(float)Width } so to say.
Is there any faster way (on ARM processors) like this? I mean: I still
have an multiplication and a shifting for every pixel.
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com