I try to make a antialias code ,starting with 4 pixels calculate average, but replace the (a+b+c+d)/4,with some downsizing to get gray pixels and replace black pixels with gray to start with?what % white pixels should grey be?
trying with SSE2 integer instructions
tests with pixel a=0,b= c= d=127
;a,b,c,d different pixels in a square 2x2
movd mm0, a ;start with get it right with 1pixel/register first
movd mm1, b
movd mm2, c
movd mm3, d
psrlw mm0, 2 ;downsizing before,otherwise endresult doesnt fit into byte
pand mm0, mask2
psrlw mm1, 2
pand mm1, mask2
psrlw mm2, 2
pand mm2, mask2
psrlw mm3, 2
pand mm3, mask2
paddusb mm0, mm1;add together 4pixels
paddusb mm2, mm3
paddusb mm0, mm2
; psrlw mm0, ?
; pand mm0,mask2
movd eax, mm0
mov result, eax;