Some optimizations to bilinear scaling
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@464 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -254,32 +254,38 @@ static void Scale_Bilinear (SDL_Surface *src, SDL_Surface *dst)
|
||||
src_p2 = src_p;
|
||||
j = i;
|
||||
|
||||
p[0] = src_p[0];
|
||||
if (y < h - 2)
|
||||
p[2] = src_p[src->w];
|
||||
else
|
||||
p[2] = 0;
|
||||
|
||||
for (x = 0; x < w; ++x)
|
||||
{
|
||||
p[0] = src_p[0];
|
||||
if (y < h - 2)
|
||||
if (j == i)
|
||||
{
|
||||
p[2] = src_p[src->w];
|
||||
if (x < w - 2)
|
||||
if (y < h - 2)
|
||||
{
|
||||
p[3] = src_p[src->w + 1];
|
||||
p[1] = src_p[1];
|
||||
if (x < w - 2)
|
||||
{
|
||||
p[1] = src_p[1];
|
||||
p[3] = src_p[src->w + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
p[1] = 0;
|
||||
p[3] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p[3] = p[2];
|
||||
p[1] = p[0];
|
||||
if (x < w - 2)
|
||||
p[1] = src_p[1];
|
||||
else
|
||||
p[1] = 0;
|
||||
p[3] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x < w - 2)
|
||||
p[1] = src_p[1];
|
||||
else
|
||||
p[1] = p[0];
|
||||
p[2] = p[0];
|
||||
p[3] = p[1];
|
||||
}
|
||||
|
||||
fa = bilinear_table[j][0];
|
||||
fb = bilinear_table[j][1];
|
||||
@@ -304,6 +310,8 @@ static void Scale_Bilinear (SDL_Surface *src, SDL_Surface *dst)
|
||||
{
|
||||
j = i;
|
||||
src_p++;
|
||||
p[0] = p[1];
|
||||
p[2] = p[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -336,32 +344,38 @@ static void Scale_Bilinear (SDL_Surface *src, SDL_Surface *dst)
|
||||
src_p2 = src_p;
|
||||
j = i;
|
||||
|
||||
p[0] = src_p[0];
|
||||
if (y < h - 2)
|
||||
p[2] = src_p[src->w];
|
||||
else
|
||||
p[2] = 0;
|
||||
|
||||
for (x = 0; x < w; ++x)
|
||||
{
|
||||
p[0] = src_p[0];
|
||||
if (y < h - 2)
|
||||
if (j == i)
|
||||
{
|
||||
p[2] = src_p[src->w];
|
||||
if (x < w - 2)
|
||||
if (y < h - 2)
|
||||
{
|
||||
p[3] = src_p[src->w + 1];
|
||||
p[1] = src_p[1];
|
||||
if (x < w - 2)
|
||||
{
|
||||
p[1] = src_p[1];
|
||||
p[3] = src_p[src->w + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
p[1] = 0;
|
||||
p[3] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p[3] = p[2];
|
||||
p[1] = p[0];
|
||||
if (x < w - 2)
|
||||
p[1] = src_p[1];
|
||||
else
|
||||
p[1] = 0;
|
||||
p[3] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x < w - 2)
|
||||
p[1] = src_p[1];
|
||||
else
|
||||
p[1] = p[0];
|
||||
p[2] = p[0];
|
||||
p[3] = p[1];
|
||||
}
|
||||
|
||||
fa = bilinear_table[j][0];
|
||||
fb = bilinear_table[j][1];
|
||||
@@ -386,6 +400,8 @@ static void Scale_Bilinear (SDL_Surface *src, SDL_Surface *dst)
|
||||
{
|
||||
j = i;
|
||||
src_p++;
|
||||
p[0] = p[1];
|
||||
p[2] = p[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user