Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Image Scaling

Name: Anonymous 2012-08-22 16:07

/prog/, do you have fast and good image scaling algorithm in the form of:
void resample(uint8_t *Dst, int DstW, int DstH, uint8_t *Src, int SrcW, int SrcH);

???

Name: Anonymous 2012-08-23 7:49

Uhhh, I think the issue is not the float multiply but the conversion from float to int for addressing, which needs to be a floor function (in this case most likely floorf()) for correct results. In fixed point you'd get the floor() for free with the truncation (sth like value >> FIX_BITS). Also, some of the muls in
uint32_t C = Src[Y*ScaleH*SrcW >> 7 + X*ScaleW >> 7];
can be omitted by using stepping values (the stepping is linear in this case).
Maybe I'll write the function later today when I'm not as lazy.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List