Sdl xflame investigation

i’ve been studying the xflame (a misnomer?) demo and
had a quick question. in all the drawflame routines
it appears there is some extra trickery going on than
just…

/* copy the calculated flame array to the image buffer */

the best i can make out, this it’s doing a simple
antialiased sort of pixel doubling. is this really
the case? i assume this is better (and quicker?) than
using SDL to do a scaled BLIT on the surface?

is there something like this in the SDL lib?

anyway, here is the snip of code from XFLAME that
i am curious about, thanks for input!

/* copy the calculated flame array to the image buffer */
im=(unsigned char *)g->screen->pixels;
for (y=0;y<(h-1);y++)
{
for (x=0;x<(w-1);x++)
{
xx=x<<1;
yy=y<<1;
ptr=f+(y<<ws)+x;
cl1=cl=(int)*ptr;
ptr=f+(y<<ws)+x+1;
cl2=(int)*ptr;
ptr=f+((y+1)<<ws)+x+1;
cl3=(int)*ptr;
ptr=f+((y+1)<<ws)+x;
cl4=(int)ptr;
cptr=im+yy
g->screen->pitch+xx;
*cptr=(unsigned char)ctab[cl%MAX];
p=cptr+1;
*p=(unsigned char)ctab[((cl1+cl2)>>1)%MAX];
p=cptr+1+g->screen->pitch;
*p=(unsigned char)ctab[((cl1+cl3)>>1)%MAX];
p=cptr+g->screen->pitch;
*p=(unsigned char)ctab[((cl1+cl4)>>1)%MAX];
}
}